import { request } from '@/utils/request.js'

// 省市区列表
export function apiGetTreeList(data = {}) {
	return request({
		url: "/area/tree",
		data,
	})
}

// 地址列表
export function list(data = {}) {
	return request({
		url: "/address/list",
		data,
	})
}

// 添加地址
export function add(data = {}) {
	return request({
		url: "/address/add",
		data,
		method: "post",
	})
}

// 修改地址
export function edit(data = {}) {
	return request({
		url: "/address/edit",
		data,
		method: "post",
	})
}

// 地址详情
export function detail(data = {}) {
	return request({
		url: "/address/detail",
		data
	})
}

// 地址删除
export function del(data = {}) {
	return request({
		url: "/address/del",
		data,
		method: "post",
	})
}

// 设置默认地址
export function setDefault(data = {}) {
	return request({
		url: "/address/setDefault",
		data,
		method: "post",
	})
}

// 自动识别地址
export function matchAddress(data = {}) {
	return request({
		url: "/match/address",
		data
	})
}